package data_structure_base;

public class Test<E extends Comparable<E>> {
    public E getMax(E[] arr) {
        E max = arr[0];
        for (int i = 1; i < arr.length; ++i) {
            if (max.compareTo(arr[i]) < 0) {
                max = arr[i];
            }
        }
        return max;
    }

    static class Person implements Comparable<Person> {

        private int age;

        public Person(int age) {
            this.age = age;
        }

        public int getAge() {
            return age;
        }

        public Person() {

        }
        @Override
        public int compareTo(Person o) {
            return this.age - o.age;
        }
    }

    public static void test1() {
        Person p1 = new Person(12);
        Person p2 = new Person(13);
        System.out.println(p1.getAge());
        System.out.println(p1.compareTo(p2) > 0);
    }

    public static void test2() {
        var p = new Person(2);
        System.out.println(p.getAge());
    }
    public static void main(String[] args) {
        var ints = new int[3];

    }

}
